Implement the previous fix in a better way, small cleanups.
authorMatthias Clasen <maclas@gmx.de>
Sun, 29 Feb 2004 00:08:04 +0000 (00:08 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 29 Feb 2004 00:08:04 +0000 (00:08 +0000)
Sun Feb 29 01:10:09 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcombobox.c: Implement the previous fix in a better way,
small cleanups.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index a958b195a2c271ca373e07a86c0d7bb4946f0a61..5b28f5304ec6d7c09300b3d0576239eb031acccd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Feb 29 01:10:09 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c: Implement the previous fix in a better way,
+       small cleanups.
+
 2004-02-28  Hans Breuer  <hans@breuer.org>
 
        * gtk/gtkfilesystemwin32.c : applied patch from
index a958b195a2c271ca373e07a86c0d7bb4946f0a61..5b28f5304ec6d7c09300b3d0576239eb031acccd 100644 (file)
@@ -1,3 +1,8 @@
+Sun Feb 29 01:10:09 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c: Implement the previous fix in a better way,
+       small cleanups.
+
 2004-02-28  Hans Breuer  <hans@breuer.org>
 
        * gtk/gtkfilesystemwin32.c : applied patch from
index a958b195a2c271ca373e07a86c0d7bb4946f0a61..5b28f5304ec6d7c09300b3d0576239eb031acccd 100644 (file)
@@ -1,3 +1,8 @@
+Sun Feb 29 01:10:09 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c: Implement the previous fix in a better way,
+       small cleanups.
+
 2004-02-28  Hans Breuer  <hans@breuer.org>
 
        * gtk/gtkfilesystemwin32.c : applied patch from
index a958b195a2c271ca373e07a86c0d7bb4946f0a61..5b28f5304ec6d7c09300b3d0576239eb031acccd 100644 (file)
@@ -1,3 +1,8 @@
+Sun Feb 29 01:10:09 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c: Implement the previous fix in a better way,
+       small cleanups.
+
 2004-02-28  Hans Breuer  <hans@breuer.org>
 
        * gtk/gtkfilesystemwin32.c : applied patch from
index a958b195a2c271ca373e07a86c0d7bb4946f0a61..5b28f5304ec6d7c09300b3d0576239eb031acccd 100644 (file)
@@ -1,3 +1,8 @@
+Sun Feb 29 01:10:09 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c: Implement the previous fix in a better way,
+       small cleanups.
+
 2004-02-28  Hans Breuer  <hans@breuer.org>
 
        * gtk/gtkfilesystemwin32.c : applied patch from
index 2c35ca37698ef42d4fb763608f9f3d30aba7a62a..3651e034c469732a8303884ae0782f073fc4ca1c 100644 (file)
  */
 
 #include "gtkcombobox.h"
+
+#include "gtkarrow.h"
+#include "gtkbindings.h"
 #include "gtkcelllayout.h"
+#include "gtkcellrenderertext.h"
 #include "gtkcellview.h"
 #include "gtkcellviewmenuitem.h"
-
-#include "gtktreeselection.h"
+#include "gtkeventbox.h"
 #include "gtkframe.h"
+#include "gtkliststore.h"
+#include "gtkmain.h"
+#include "gtkmenu.h"
 #include "gtktogglebutton.h"
+#include "gtktreeselection.h"
 #include "gtkvseparator.h"
-#include "gtkarrow.h"
-#include "gtkmenu.h"
-#include "gtkmain.h"
-#include "gtkeventbox.h"
-#include "gtkcellrenderertext.h"
-#include "gtkbindings.h"
-#include "gtkliststore.h"
 #include "gtkwindow.h"
 
 #include <gdk/gdkkeysyms.h>
@@ -191,8 +191,7 @@ static void     gtk_combo_box_get_property         (GObject         *object,
                                                     GParamSpec      *spec);
 
 static void     gtk_combo_box_style_set            (GtkWidget       *widget,
-                                                    GtkStyle        *previous_style,
-                                                    gpointer         data);
+                                                    GtkStyle        *previous);
 static void     gtk_combo_box_button_toggled       (GtkWidget       *widget,
                                                     gpointer         data);
 static void     gtk_combo_box_add                  (GtkContainer    *container,
@@ -557,8 +556,7 @@ gtk_combo_box_get_property (GObject    *object,
 
 static void
 gtk_combo_box_style_set (GtkWidget *widget,
-                         GtkStyle  *previous_style,
-                         gpointer   data)
+                         GtkStyle  *previous)
 {
   gboolean appearance;
   GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
@@ -732,7 +730,8 @@ gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
       if (combo_box->priv->popup_window)
         {
           gtk_widget_destroy (combo_box->priv->popup_window);
-          combo_box->priv->popup_window = combo_box->priv->popup_frame = NULL;
+          combo_box->priv->popup_window = NULL;
+         combo_box->priv->popup_frame = NULL;
         }
 
       combo_box->priv->popup_widget = popup;
@@ -751,6 +750,7 @@ gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
       if (!combo_box->priv->popup_window)
         {
           combo_box->priv->popup_window = gtk_window_new (GTK_WINDOW_POPUP);
+         gtk_window_set_resizable (GTK_WINDOW (combo_box->priv->popup_window), FALSE);
           gtk_window_set_screen (GTK_WINDOW (combo_box->priv->popup_window),
                                  gtk_widget_get_screen (GTK_WIDGET (combo_box)));
 
@@ -759,6 +759,7 @@ gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
                                      GTK_SHADOW_NONE);
           gtk_container_add (GTK_CONTAINER (combo_box->priv->popup_window),
                              combo_box->priv->popup_frame);
+
           gtk_widget_show (combo_box->priv->popup_frame);
         }
 
@@ -818,7 +819,7 @@ gtk_combo_box_menu_position (GtkMenu  *menu,
 void
 gtk_combo_box_popup (GtkComboBox *combo_box)
 {
-  gint x, y, width, height, popup_height;
+  gint x, y, width, height;
   GtkWidget *sample;
 
   g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
@@ -862,9 +863,7 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
             GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness);
     }
 
-  gtk_window_get_size (combo_box->priv->popup_window, NULL, &popup_height);
   gtk_widget_set_size_request (combo_box->priv->popup_window, width, -1);
-  gtk_window_resize (combo_box->priv->popup_window, width, popup_height);
   
   if (GTK_WIDGET_NO_WINDOW (sample))
     {
@@ -1982,6 +1981,7 @@ gtk_combo_box_list_remove_grabs (GtkComboBox *combo_box)
   if (GTK_WIDGET_HAS_GRAB (combo_box->priv->popup_window))
     {
       gtk_grab_remove (combo_box->priv->popup_window);
+      gdk_keyboard_ungrab (GDK_CURRENT_TIME);
       gdk_pointer_ungrab (GDK_CURRENT_TIME);
     }
 }
@@ -2585,7 +2585,7 @@ gtk_combo_box_set_wrap_width (GtkComboBox *combo_box,
       combo_box->priv->wrap_width = width;
       
       gtk_combo_box_relayout (combo_box);
-      gtk_combo_box_style_set (combo_box, NULL, NULL);
+      gtk_combo_box_style_set (GTK_WIDGET (combo_box), NULL);
       
       g_object_notify (G_OBJECT (combo_box), "wrap_width");
     }